<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ page session="false" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.net.test.vo.ExamVO" %>

<script>

function go_write(){
	var frm = document.myfrm;
	frm.action = "/examWrite.ncb";
	frm.submit();
	
}

function go_view(param){
	var frm = document.myfrm;
	frm.title.value = param;
	frm.action = "/examView.ncb";
	frm.submit();
}

</script>


<div style="width:600px; height: 600px; ">



<form name="myfrm" method="post">
    
    <input type="hidden" name="title">
    
    
    <table width="90%" cellpadding="5" cellspacing="0" border="1" style="border-collapse:collapse; border:1px gray solid;">
        <tr>
            <td width="10%" align="center">번호</td>
            <td width="30%" align="center">제목</td>
            <td width="50%" align="center">내용</td>
            <td width="60%" align="center">날짜</td>
            
        </tr>
        
        <%
        ArrayList<ExamVO> list = (ArrayList<ExamVO>)request.getAttribute("list");
        %>
        
        <%
        for(int i = 0; i<list.size(); i++){
        %>
        <tr>
            <td width="10%" align="center" > <%=i+1 %> </td>
            <td width="30%" align="center" onclick="javascript:go_view('<%=list.get(i).getBoard_Title() %>')" > <%=list.get(i).getBoard_Title() %></td>
            <td width="50%" align="center"><%=list.get(i).getBoard_Contents() %></td>
        </tr>
        <%
        }
        %>
    </table>
    
	<input type="button" value="글쓰기" onclick="javascript:go_write();"/>

</form>

</div>
